import { Resolve, ActivatedRouteSnapshot } from "@angular/router";
import { Product } from "../product/product.component";
import { Injectable } from "@angular/core";

@Injectable()
export class ProductResolve implements Resolve<Product> {
  resolve(route: ActivatedRouteSnapshot): Product {
    let id = route.queryParams["id"];
    console.log(id);
    return new Product(id,"商品名称","http://placehold.it/320x150");
  }
}
